package com.zmzncs.lmtc.module.promotion.pojo.month_rule;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.zmzncs.lmtc.common.pojo.enums.optionalvalue.promotion.RuleStatusEnum;
import com.zmzncs.lmtc.common.util.EnumUtil;
import com.zmzncs.lmtc.module.promotion.pojo.month_rule_fee_scale.MonthRuleFeeScaleDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 任建波
 * @since 2020-08-12
 */
@Data
public class MonthRuleDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "规则Id")
    private Long ruleId;

    @ApiModelProperty(value = "停车场Id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long parkId;

    @ApiModelProperty(value = "规则金额Id")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long feeScaleId;

    @ApiModelProperty(value = "规则名称", required = true)
    private String ruleName;

    @ApiModelProperty(value = "描述")
    private String remark;

    @ApiModelProperty(value = "停车场数量")
    private String parkCount;

    @ApiModelProperty(value = "规则")
    private List<MonthRuleFeeScaleDTO> feeScaleList;

    @ApiModelProperty(value = "OPEN：开启，CLOSE：关闭")
    private RuleStatusEnum status;

    @ApiModelProperty(value = "充值人次")
    private Integer payCount;

    @ApiModelProperty(value = "充值总金额（元）")
    private BigDecimal payAmount;

    @ApiModelProperty(value = "创建人id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    private Date updateTime;

    @ApiModelProperty(value = "删除标志：1：是   0：否")
    private Integer isDeleted;

    @ApiModelProperty(value = "月租规则id")
    private Long monthRuleId;

    @ApiModelProperty(value = "拉取月租id")
    private Long monthRulePullId;

    @ApiModelProperty(value = "月租类型（全天年卡81，全天半年卡82，全天季卡83，全天月卡84，白间卡月卡85，夜间月卡86 ）")
    private Integer monthRentType;

    @ApiModelProperty(value = "中萌停车场月租类型（81：全天年卡，83：全天季卡，84：全天月卡，85：白间月卡，86：夜间月卡）")
    private Integer uniformRentType;

    @ApiModelProperty(value = "月租名称")
    private String monthRentName;

    @ApiModelProperty(value = "车场主端状态（1：开启，0：关闭）")
    private Integer ownerStatus;

    @ApiModelProperty(value = "客户端状态（1：开启，0：关闭）")
    private Integer clientStatus;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "车场金额")
    private BigDecimal parkAmount;

    @ApiModelProperty(value = "增加手续费金额")
    private BigDecimal serviceAddAmount;

    @ApiModelProperty(value = "月租每天开始时间")
    private Date beginTime;

    @ApiModelProperty(value = "月租每天结束时间")
    private Date endTime;

    @ApiModelProperty(value = "月租天数")
    private Integer days;


    public void setStatus(Integer status) {
        RuleStatusEnum ruleStatusEnum = EnumUtil.getByCode(status, RuleStatusEnum.class);

        this.status = ruleStatusEnum;
    }

}
